package com.cxm.weilai.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 图片校验
 *
 * @author admin
 */
public class ValidImage {

    /**
     * 图片校验（后缀）
     *
     * @param fileName 图片名称
     * @return boolean
     */
    public static boolean validImages(String fileName) {
        String reg = "(jpeg|jpg|gif|bmp|png)$";
        Pattern pattern = Pattern.compile(reg);
        Matcher matcher = pattern.matcher(fileName.toLowerCase());
        return matcher.find();

    }
}
